package zm.irc.cmd;

import org.apache.log4j.Logger;

import zm.irc.client.IrcClient;
import zm.irc.dao.InterestingTextDao;
import zm.irc.dto.InterestingTextInfo;
import zm.irc.ioc.annotation.AutoWired;
import zm.irc.ioc.annotation.Service;
import zm.irc.message.receive.IrcReceiveCmdMessage;


/**
 * <pre>
 * 舔狗日记: Simp diary
 * </pre>
 */
public abstract class AbsCmdTianXin implements IrcChatMsgCmd{

    private static final Logger log = Logger.getLogger(CmdSayLove.class);

    @AutoWired
    private InterestingTextDao interestingTextDao;

    public AbsCmdTianXin(){
    }

    @Override
    public final boolean execute(IrcReceiveCmdMessage cmd, IrcClient client) {
        InterestingTextInfo info = this.doExecute(cmd, client);
        if( info != null){
            interestingTextDao.saveMessage(info);
        }
     
        return true;
    }

    protected abstract InterestingTextInfo doExecute(IrcReceiveCmdMessage cmd, IrcClient client);

    
}
